﻿<?php
include("../Modules/gv_resist_mdl.php");
// include('doctype.htm');
include("../Modules/conn.php");

// Request selected language
$hl = (isset($_POST["hl"])) ? $_POST["hl"] : false;
if(!defined("L_LANG") || L_LANG == "L_LANG")
{
	if($hl) define("L_LANG", $hl);

	// You need to tell the class which language do you use.
	// L_LANG should be defined as en_US format!!! Next line is an example, just put your own language from the provided list
	else define("L_LANG", "vi_VN"); // Greek example
}
// IMPORTANT: Request the selected date from the calendar
// $mydate = isset($_POST["date1"]) ? $_POST["date1"] : "";
// Note: this sample doesn't show you how to use the $mydate variable with your database, but you can handle it as any other php variable in your script!

?>

<script language="javascript" src="datetimepicker/calendar/calendar.js"></script>
<script language="javascript">
	
	// Kiem tra cac truong trong form co bi bo trong hay khong
	function emptyCheck()
	{
		if (document.frmAddNKGD.txtNDD.value == "")
			document.frmAddNKGD.smtNKGD.disabled = true;
		else document.frmAddNKGD.smtNKGD.disabled = false;
	}
	
	function formPrompt()
	{
		if (confirm("Bạn có chắc muốn ghi nhật ký với những thông tin này?"))
			return true;
		else return false;
	}
</script>

<table align="center" class="opinion">
<tr> <td class="tableHeader" colspan="2"><h4>GHI NHẬT KÝ</h4></td></tr>

<form method="POST" action="../Modules/gv_ghinkgd_mdl.php" name="frmAddNKGD" onsubmit="return formPrompt();" onreset="this.smtNKGD.disabled = true">
	<tr><td class="name">Ngày học</td>
		<td><?php										
			// Nhung datepicker
			require('datetimepicker/calendar/tc_calendar.php');
			$myCalendar = new tc_calendar("date1", true);
			$myCalendar->setIcon("datetimepicker/calendar/images/iconCalendar.gif");
			$myCalendar->setDate(date('d'), date('m'), date('Y'));
			$myCalendar->setPath('datetimepicker/calendar');
			$myCalendar->dateAllow('01-01-1960', date('d-m-Y'));
			$myCalendar->disabledDay("sun");
			$myCalendar->writeScript();
			?></td></tr>
	<tr><td class="name">Số tiết</td>
		<td><select name="cboSoTiet">
		<option value="1">1</option>
		<option value="2">2</option>
		<option value="3">3</option>
		<option value="4">4</option>
		</select></td></tr>
	<tr><td rowspan="2" class="name">Nội dung dạy</td><td><textarea name="txtNDD" onkeyup="emptyCheck();" cols="50" rows="4"></textarea></td>
	<tr><td><input type="submit" value="Lưu" name="smtNKGD" disabled="true">
			<input type="reset" value="Nhập lại" name="resNKGD"> </td></tr>
</form>
</table>